# -*- coding: utf-8 -*-
"""
author:码同学 极光
date:2024/3/24
desc: 
sample: 
"""
name = "testfan"
print("第一个方法")
name2 = name[::-1]
print(name2)

print("第二个方法")
list = []
for i in range(len(name)-1,-1,-1):
   list.append(name[i])
print("".join(list))

print("第三个方法")
name3=''
for i in range(len(name)-1,-1,-1):
   name3+=name[i]

print(name3)

print("第四个方法")
list = []
for i in name:
    list.append(i)
list.reverse()
str = "".join(list)
print(str)

print("第5个方法")
name5= reversed(name)
str = ''.join(name5)
print(str)

# reverse（list方法）  reversed（函数，独立对象 迭代器） 区别